﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GoldenAgeHelper.db
{
    public static class Database
    {

        public static IDBHelper helper;

        //static Database()
        //{
        //    helper = new SqlHelper2(ConnectString);
        //}

        //private static string connectstr;

        //public static string ConnectString
        //{
        //    get { return connectstr; }
        //    set { connectstr = value; }
        //}

        public static void Connect(string connectstring)
        {
            //helper = new SqlHelper2(connectstring);
            Connect(DBType.SQL, connectstring);
        }

        public static void Connect(DBType type,string connectstring)
        {
            types = type;
            switch (type)
            {
                case DBType.SQL:
                    helper = new SqlHelper2(connectstring);
                    break;
                case DBType.Access:
                    helper = new AccessHelper2(connectstring);
                    break;
                default:
                    break;
            }
        }

        public static DBType types;

    }

    public enum DBType
    {
        SQL,
        Access
    }
}
